import numpy as np

def load_data(path):
    data = np.load(path)
    imgs = data['data']
    return imgs

#获取保留维度数量
def get_k(array, ratio):
    remain = np.sum(array) * ratio
    Sum = 0
    for k, item in enumerate(array):
       Sum += item
       if Sum > remain:
           return k